package com.company;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * 场景类
 */
public class Client {
	public static void main(String[] args) throws IOException {
		Invoker invoker = new Invoker();
		while(true){
			// unix 写的默认提示符号
			System.out.print("#");
			// 捕获输出
			String input = (new BufferedReader(new InputStreamReader(System.in))).readLine();
			// 输入 quit 或 exit 则退出
			if(input.equals("quit") || input.equals("exit")){
				return;
			}
			System.out.println(invoker.exec(input));
		}
	}
}
/* Output:
#ls     // 键盘输入的命令
file1
file2
file3
file4
#ls -l
drw-rw-rw    root    system    1024   2009-8-20 10:23   file1
drw-rw-rw    root    system    1024   2009-8-20 10:23   file2
drw-rw-rw    root    system    1024   2009-8-20 10:23   file3
#ls -a
.
..
file1
file2
file3
#df
/	10485760
/usr	104857600
/home	1048576000

#df -k
/	10240
/usr	102400
/home	t10240000

#df -g
/	10
/usr	100
/home	t10000
#quit
*///